

# ListenType

<div class="api-docs__separator" data-reactroot="">

---

</div><div class="api-docs__import" data-reactroot="">

```ts
import { ListenType } from "@hyper-fetch/sockets"
```

</div><div class="api-docs__section">

## Description

</div><div class="api-docs__description"><span class="api-docs__do-not-parse">



</span></div><p class="api-docs__definition">

Defined in [listener/listener.types.ts:15](https://github.com/BetterTyped/hyper-fetch/blob/cc329b91/packages/sockets/src/listener/listener.types.ts#L15)

</p><div class="api-docs__section">

## Preview

</div><div class="api-docs__preview type single">

```ts
type ListenType<Listener,Adapter> = (options: ExtractRouteParams<ExtractListenerEndpointType<Listener>> extends NegativeTypes ? { callback: ListenerCallbackType<Adapter, ExtractListenerResponseType<Listener>> } : ExtractListenerHasParams<Listener> extends false ? { callback: ListenerCallbackType<Adapter, ExtractListenerResponseType<Listener>>; params: ExtractRouteParams<ExtractListenerEndpointType<Listener>> } : { callback: ListenerCallbackType<Adapter, ExtractListenerResponseType<Listener>>; params?: never }) => () => void;
```

</div><div class="api-docs__section">

## Structure

</div><div class="api-docs__returns">

```ts
(options: ExtractRouteParams<ExtractListenerEndpointType<Listener>> extends NegativeTypes ? {
  callback: ListenerCallbackType<Adapter, ExtractListenerResponseType<Listener>>;
} : (ExtractListenerHasParams<Listener> extends false ? {
  callback: ListenerCallbackType<Adapter, ExtractListenerResponseType<Listener>>;
  params: ExtractRouteParams<ExtractListenerEndpointType<Listener>>;
} : {
  callback: ListenerCallbackType<Adapter, ExtractListenerResponseType<Listener>>;
  params: never;
})) => () => void
```

</div>